import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';

@Component({
  selector: 'app-c-web',
  templateUrl: './c-web.component.html',
  styleUrls: ['./c-web.component.less']
})
export class CWebComponent implements OnInit {

    @Output() dataChange = new EventEmitter<object>();
    @Output() onBlur = new EventEmitter<object>();

    @Input() canEdit;

    @Input() data;



    constructor(public sanitizer: DomSanitizer) { }

    ngOnInit() {
        this.data.src = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.src.changingThisBreaksApplicationSecurity);
    }

    blur() {
        this.onBlur.emit();
    }

}
